<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

get_config_keytable("knowledge_Increase");
empty($do) && $do = 'list';
if ($do == 'list') {
	include_once('template/add.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$categoryid = getGP('officetypeid','P');
	$title = getGP('title','P');
	$content = getGP('content','P');
	$number = getGP('number','P');
	$type = getGP('type','P');
	if (getGP('date','P')!=''){
	$udate = getGP('date','P');
	}else{
	$udate=get_date('Y-m-d h:i:s',PHP_TIME);
	}
	
	//主表信息
	$knowledge = array(
		'uid' => $_USER->id,
		'title' => $title,
		'content' => $content,
		'number' => $number,
		'categoryid' => $categoryid,
		'type' => $type,
		'date' => $udate
	);
	//写入主表信息
	insert_db('knowledge',$knowledge);
	$id=$db->insert_id();
	$content=$title.get_inc_log(1).$content.get_inc_log(1).$number.get_inc_log(1).$categoryid.get_inc_log(1).$type;
	$title='新增知识';
	get_oa_log_dbadd($id,$content,$title,17,$_USER->id);
    goto_page('admin.php?ac=index&fileurl=knowledge');

}
?>